package com.jiyun.controller;

import com.jiyun.pojo.NCustomer;
import com.jiyun.service.INCustomerService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RestController
@CrossOrigin
@RequestMapping("/customer")
public class NCustomerController {
    @Autowired
    private INCustomerService nCustomerService;
    @GetMapping("findOne1")
    public NCustomer findOne(@RequestParam("id") Integer id){
        NCustomer list= nCustomerService.findOne(id);
        return list;
    }
    @GetMapping("findOne")
    public List<NCustomer> findAll(){
        List<NCustomer> list= nCustomerService.findAll();
        return list;
    }

    @GetMapping("/findPhone")
    public NCustomer findPhone(@RequestParam("phone") String phone){
        NCustomer list= nCustomerService.findPhone(phone);
        return list;
    }
}
